Integrand size = 14, antiderivative size = 53 \[ \int x^2 \sqrt {a+a \cos (x)} \, dx=8 x \sqrt {a+a \cos (x)}-16 \sqrt {a+a \cos (x)} \tan \left (\frac {x}{2}\right )+2 x^2 \sqrt {a+a \cos (x)} \tan \left (\frac {x}{2}\right ) \]
[Out]
Time = 0.20 (sec) , antiderivative size = 53, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.214, Rules used = {3400, 3377, 2717} \[ \int x^2 \sqrt {a+a \cos (x)} \, dx=2 x^2 \tan \left (\frac {x}{2}\right ) \sqrt {a \cos (x)+a}+8 x \sqrt {a \cos (x)+a}-16 \tan \left (\frac {x}{2}\right ) \sqrt {a \cos (x)+a} \]
[In]
[Out]
Rule 2717
Rule 3377
Rule 3400
Rubi steps \begin{align*} \text {integral}& = \left (\sqrt {a+a \cos (x)} \sec \left (\frac {x}{2}\right )\right ) \int x^2 \cos \left (\frac {x}{2}\right ) \, dx \\ & = 2 x^2 \sqrt {a+a \cos (x)} \tan \left (\frac {x}{2}\right )-\left (4 \sqrt {a+a \cos (x)} \sec \left (\frac {x}{2}\right )\right ) \int x \sin \left (\frac {x}{2}\right ) \, dx \\ & = 8 x \sqrt {a+a \cos (x)}+2 x^2 \sqrt {a+a \cos (x)} \tan \left (\frac {x}{2}\right )-\left (8 \sqrt {a+a \cos (x)} \sec \left (\frac {x}{2}\right )\right ) \int \cos \left (\frac {x}{2}\right ) \, dx \\ & = 8 x \sqrt {a+a \cos (x)}-16 \sqrt {a+a \cos (x)} \tan \left (\frac {x}{2}\right )+2 x^2 \sqrt {a+a \cos (x)} \tan \left (\frac {x}{2}\right ) \\ \end{align*}
Time = 0.10 (sec) , antiderivative size = 29, normalized size of antiderivative = 0.55 \[ \int x^2 \sqrt {a+a \cos (x)} \, dx=8 \sqrt {a (1+\cos (x))} \left (x+\frac {1}{4} \left (-8+x^2\right ) \tan \left (\frac {x}{2}\right )\right ) \]
[In]
[Out]
Result contains complex when optimal does not.
Time = 0.49 (sec) , antiderivative size = 70, normalized size of antiderivative = 1.32
method | result | size |
risch | \(-\frac {i \sqrt {2}\, \sqrt {a \left ({\mathrm e}^{i x}+1\right )^{2} {\mathrm e}^{-i x}}\, \left (4 i x \,{\mathrm e}^{i x}+x^{2} {\mathrm e}^{i x}+4 i x -x^{2}-8 \,{\mathrm e}^{i x}+8\right )}{{\mathrm e}^{i x}+1}\) | \(70\) |
[In]
[Out]
Exception generated. \[ \int x^2 \sqrt {a+a \cos (x)} \, dx=\text {Exception raised: TypeError} \]
[In]
[Out]
\[ \int x^2 \sqrt {a+a \cos (x)} \, dx=\int x^{2} \sqrt {a \left (\cos {\left (x \right )} + 1\right )}\, dx \]
[In]
[Out]
none
Time = 0.40 (sec) , antiderivative size = 36, normalized size of antiderivative = 0.68 \[ \int x^2 \sqrt {a+a \cos (x)} \, dx=2 \, {\left (\sqrt {2} x^{2} \sin \left (\frac {1}{2} \, x\right ) + 4 \, \sqrt {2} x \cos \left (\frac {1}{2} \, x\right ) - 8 \, \sqrt {2} \sin \left (\frac {1}{2} \, x\right )\right )} \sqrt {a} \]
[In]
[Out]
none
Time = 0.28 (sec) , antiderivative size = 43, normalized size of antiderivative = 0.81 \[ \int x^2 \sqrt {a+a \cos (x)} \, dx=2 \, \sqrt {2} {\left (4 \, x \cos \left (\frac {1}{2} \, x\right ) \mathrm {sgn}\left (\cos \left (\frac {1}{2} \, x\right )\right ) + {\left (x^{2} \mathrm {sgn}\left (\cos \left (\frac {1}{2} \, x\right )\right ) - 8 \, \mathrm {sgn}\left (\cos \left (\frac {1}{2} \, x\right )\right )\right )} \sin \left (\frac {1}{2} \, x\right )\right )} \sqrt {a} \]
[In]
[Out]
Time = 13.61 (sec) , antiderivative size = 70, normalized size of antiderivative = 1.32 \[ \int x^2 \sqrt {a+a \cos (x)} \, dx=\frac {2\,\sqrt {a}\,\sqrt {\cos \left (x\right )+1}\,\left (x^2\,\cos \left (x\right )-8\,\cos \left (x\right )-4\,x\,\sin \left (x\right )-x^2+8+x\,4{}\mathrm {i}-\sin \left (x\right )\,8{}\mathrm {i}+x^2\,\sin \left (x\right )\,1{}\mathrm {i}+x\,\cos \left (x\right )\,4{}\mathrm {i}\right )}{\cos \left (x\right )\,1{}\mathrm {i}-\sin \left (x\right )+1{}\mathrm {i}} \]
[In]
[Out]